<style>
    .layui-form .layui-form-item .layui-inline .layui-form-label {
        width: 100px;
    }
</style>
<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" >商户名称：</label>
            <div class="layui-input-inline seller-inline-3" style="width: 300px;">
                <input type="text" name="shopping" placeholder="shopping" autocomplete="off"
                       maxlength="50" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="search"><i class="iconfont icon-chaxun"></i>Search</button>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline" style="font-size: 18px;">
            <span>只需要输入网站域名,商户 或平台名称关键字如:</span><br/>
            <span>Amazon,APPLE.COM,PAYPAL,SPACESHIP.COM,eBay,SHOPIFY,BRIGHT,FACEBK,PORKBUN.COM,ExpressVPN<br/>
            <span>就能快速获得哪些卡段能支付此应用场景</span></span><br/>
            <span style="color: red">注意:查询不到的应用场景,不代表此场景不可使用(目前的查询是针对消费日志的商户进行搜索)</span><br/>
            <span>只计算交易成功的次数:status='Authorized' 或 status='Posted'</span>;
        </div>
    </div>
</form>

<div class="table-body">
    <table id="dataTable" lay-filter="dataTable" ></table>
</div>

<script>
    layui.use(['form',  'table'], function () {
        var tableIn = layui.table.render({
            elem: '#dataTable',
            height: 'full-99',
            cellMinWidth: '80',
            url: "{:url('index')}",
            method:'POST',
            cols: [[
                { type: 'numbers'},
                { field: 'card_type', title: '卡段',align:"left",width:200},
                {field: 'shopping', title: '商户名称', align:"left",width:300,
                    // templet: function (d) {
                    //     var shop = d.shopping;
                    //     var shop_array = shop.split(',');
                    //
                    //     return shop_array;
                    // }
                },
                { field: 'success_num', title: '近期授权成功次数', align:"left"},
                { field: 'ctime', align: 'center', title: '最新交易时间'}
            ]],
            page: true,
            limit: 50,
            limits: [50],
        });
        layui.form.on('submit(search)', function (data) {
            layui.table.reload('dataTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                },
                method:'POST'
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>